package antidestiny.utilib.io;

/**
 * Created by Hero on 2016/1/6.
 */
public class Progress {
    int i=0;
    int max=100;

    public void setMax(int max) {
        if (max<0) throw new RuntimeException("最大值max不应小于0");
        this.max = max;
    }

    public int getMax() {
        return max;
    }

    OnDataChangeListener listener;
    public int getI() {
        return i;
    }

    public void setI(int i) {
        if (i>max)throw new RuntimeException("进度的值不该大于最大值：i:"+i+"max："+max);
        this.i = i;
        if (listener!=null)listener.onDatachange();
    }
    public   void setOnDataChangeListener(OnDataChangeListener listener){
        this.listener=listener;
    }
}
